﻿using NewRetail.Application.Components.Goods.Entity;
using NewRetail.Application.Core.Entity;
using System;

namespace NewRetail.Application.Components.Warehouse.Entity
{
    public class CheckStock : BaseEntity, IReceiptEntity, IWarehouseEntity
    {
        public string receiptNo { get; set; }
        public DateTime receiptDate { get; set; }
        public string goodsID { get; set; }
        public string goodsName { get; set; }
        public string warehouseID { get; set; }

        public decimal oldNum { get; set; }

        public decimal newNum { get; set; }

        private decimal? _ProfitOrloss;
        public decimal? ProfitOrloss
        {
            get
            {
                if (this._ProfitOrloss == decimal.Zero || this._ProfitOrloss == null)
                {
                    return this.newNum - this.oldNum;
                }
                return this._ProfitOrloss;
            }
            set
            {
                this._ProfitOrloss = value;
            }
        }
        public string remark { get; set; }
        public bool isAuditing { get; set; }
        public int? operateUserID { get; set; }
        public DateTime? operateTime { get; set; }

        public Warehouse Warehouse { get; set; }
        public GoodsInfo GoodsInfo { get; set; }
    }
}
